SRCS = $(wildcard *.cpp)
SRCS += $(wildcard *.c)
TARGETS = $(foreach src, $(SRCS), $(basename $(src)) )

CFLAGS += -pipe -Wall -g
CDFLAGS += -lm -lpcre

.PHONY : all clean

all : $(TARGETS)

$(TARGETS) : % : %.o 
	    g++ $(CFLAGS) $(CDFLAGS) -o $@ $<


clean :
	    -rm $(TARGETS) *.o

##################################

.SUFFIXES : .cpp .c
.cpp.o :
	    $(CXX) $(CFLAGS) -c -o $@ $<

.c.o :
	    $(CXX) $(CFLAGS) -c -o $@ $<
